(function() {
    var i = 0;
    function promise(callback) {
        if(i >= JSConfig.OnCompleteScripts.length) {
            callback();
            return;
        }
        var script = JSConfig.OnCompleteScripts[i];
        if(script === "js/swagger.translator.js") {
            callback();
        } else {
            $.getScript(script).success(function() {
                i++;
                promise(callback);
            });
        }
    };

    promise(function() {
        if(window.SwaggerTranslator) {
            window.SwaggerTranslator.translate();
        }
    });

})();